<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
<title>Atomix level sets in JSON format.</title>
<style type="text/css">

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 5951 2009-05-18 18:03:10Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.

See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/

/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
  border: 0 }

table.borderless td, table.borderless th {
  /* Override padding for "table.docutils td" with "! important".
     The right padding separates the table cells. */
  padding: 0 0.5em 0 0 ! important }

.first {
  /* Override more specific margin styles with "! important". */
  margin-top: 0 ! important }

.last, .with-subtitle {
  margin-bottom: 0 ! important }

.hidden {
  display: none }

a.toc-backref {
  text-decoration: none ;
  color: black }

blockquote.epigraph {
  margin: 2em 5em ; }

dl.docutils dd {
  margin-bottom: 0.5em }

/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
  font-weight: bold }
*/

div.abstract {
  margin: 2em 5em }

div.abstract p.topic-title {
  font-weight: bold ;
  text-align: center }

div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
  margin: 2em ;
  border: medium outset ;
  padding: 1em }

div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
  font-weight: bold ;
  font-family: sans-serif }

div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
  color: red ;
  font-weight: bold ;
  font-family: sans-serif }

/* Uncomment (and remove this text!) to get reduced vertical space in
   compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
  margin-bottom: 0.5em }

div.compound .compound-last, div.compound .compound-middle {
  margin-top: 0.5em }
*/

div.dedication {
  margin: 2em 5em ;
  text-align: center ;
  font-style: italic }

div.dedication p.topic-title {
  font-weight: bold ;
  font-style: normal }

div.figure {
  margin-left: 2em ;
  margin-right: 2em }

div.footer, div.header {
  clear: both;
  font-size: smaller }

div.line-block {
  display: block ;
  margin-top: 1em ;
  margin-bottom: 1em }

div.line-block div.line-block {
  margin-top: 0 ;
  margin-bottom: 0 ;
  margin-left: 1.5em }

div.sidebar {
  margin: 0 0 0.5em 1em ;
  border: medium outset ;
  padding: 1em ;
  background-color: #ffffee ;
  width: 40% ;
  float: right ;
  clear: right }

div.sidebar p.rubric {
  font-family: sans-serif ;
  font-size: medium }

div.system-messages {
  margin: 5em }

div.system-messages h1 {
  color: red }

div.system-message {
  border: medium outset ;
  padding: 1em }

div.system-message p.system-message-title {
  color: red ;
  font-weight: bold }

div.topic {
  margin: 2em }

h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  margin-top: 0.4em }

h1.title {
  text-align: center }

h2.subtitle {
  text-align: center }

hr.docutils {
  width: 75% }

img.align-left, .figure.align-left{
  clear: left ;
  float: left ;
  margin-right: 1em }

img.align-right, .figure.align-right {
  clear: right ;
  float: right ;
  margin-left: 1em }

.align-left {
  text-align: left }

.align-center {
  clear: both ;
  text-align: center }

.align-right {
  text-align: right }

/* reset inner alignment in figures */
div.align-right {
  text-align: left }

/* div.align-center * { */
/*   text-align: left } */

ol.simple, ul.simple {
  margin-bottom: 1em }

ol.arabic {
  list-style: decimal }

ol.loweralpha {
  list-style: lower-alpha }

ol.upperalpha {
  list-style: upper-alpha }

ol.lowerroman {
  list-style: lower-roman }

ol.upperroman {
  list-style: upper-roman }

p.attribution {
  text-align: right ;
  margin-left: 50% }

p.caption {
  font-style: italic }

p.credits {
  font-style: italic ;
  font-size: smaller }

p.label {
  white-space: nowrap }

p.rubric {
  font-weight: bold ;
  font-size: larger ;
  color: maroon ;
  text-align: center }

p.sidebar-title {
  font-family: sans-serif ;
  font-weight: bold ;
  font-size: larger }

p.sidebar-subtitle {
  font-family: sans-serif ;
  font-weight: bold }

p.topic-title {
  font-weight: bold }

pre.address {
  margin-bottom: 0 ;
  margin-top: 0 ;
  font: inherit }

pre.literal-block, pre.doctest-block {
  margin-left: 2em ;
  margin-right: 2em }

span.classifier {
  font-family: sans-serif ;
  font-style: oblique }

span.classifier-delimiter {
  font-family: sans-serif ;
  font-weight: bold }

span.interpreted {
  font-family: sans-serif }

span.option {
  white-space: nowrap }

span.pre {
  white-space: pre }

span.problematic {
  color: red }

span.section-subtitle {
  /* font-size relative to parent (h1..h6 element) */
  font-size: 80% }

table.citation {
  border-left: solid 1px gray;
  margin-left: 1px }

table.docinfo {
  margin: 2em 4em }

table.docutils {
  margin-top: 0.5em ;
  margin-bottom: 0.5em }

table.footnote {
  border-left: solid 1px black;
  margin-left: 1px }

table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
  padding-left: 0.5em ;
  padding-right: 0.5em ;
  vertical-align: top }

table.docutils th.field-name, table.docinfo th.docinfo-name {
  font-weight: bold ;
  text-align: left ;
  white-space: nowrap ;
  padding-left: 0 }

h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  font-size: 100% }

ul.auto-toc {
  list-style-type: none }

</style>
</head>
<body>
<div class="document" id="atomix-level-sets-in-json-format">
<h1 class="title">Atomix level sets in JSON format.</h1>

<pre class="literal-block">
This document is an informal specification of the JSON[1] format used by
Atomix Online at SDF[2] to describe Atomix level sets.
</pre>
<ol class="arabic simple">
<li><a class="reference external" href="http://ledger.sdf.org/atomix/">http://ledger.sdf.org/atomix/</a></li>
<li><a class="reference external" href="http://www.json.org/">http://www.json.org/</a></li>
</ol>
<pre class="literal-block">
Each file must contain  a single levelSet' object and be encoded using
the Unicode 'utf-8' format.
</pre>
<div class="section" id="the-levelset-object">
<h1>The levelSet object</h1>
<pre class="literal-block">
The levelSet object is a key/value dictionary containing administrative
information and a list of 'level' objects.

 name:

   The name of the level set, eg 'katomic'


 credits:

   A link to a page identifying the author or organisation who own the
   copyright for the levels (html format).

   example:

     &quot;credits&quot;:
       &quot;&lt;a href='http://games.kde.org/game.php?game=katomic'&gt;Katomic Team&lt;/a&gt;&quot;


 license:

   A link to an page describing the license which controls the use of this
   level set (html format).

   example:

     &quot;license&quot;: &quot;&lt;a href='http://www.gnu.org/licenses/gpl.html'&gt;GPL&lt;/a&gt;&quot;


 levels:

   An ordered list of 'level' objects. The order in which the levels
   appear in the list is the order that the levels should be presented to
   user.
</pre>
</div>
<div class="section" id="the-level-object">
<h1>The 'level' object</h1>
<pre class="literal-block">
Each level in the set is described by a level object.

 id:

   This item should be a string that uniquely identifies the level within
   the set. It should be short and use only the letters [a-z] the digits
   [0-9] or the underscore (_). The lexicographical ordering of the id's
   should not be regarded as significant.

 name:

   A name to be used when describing the level to the end user. The name
   should not be regarded as an identifier as it may change over time or
   differ according to language contexts.

 atoms:

   A dictionary where the keys are single characters that are used to
   identify individual atoms used in the molecule and the values are atom
   descriptors to be described later.

   example:

     &quot;atoms&quot;: {
       &quot;1&quot;: [&quot;1&quot;, &quot;b&quot;],
       &quot;2&quot;: [&quot;1&quot;, &quot;d&quot;],
       &quot;3&quot;: [&quot;3&quot;, &quot;bf&quot;],
       &quot;4&quot;: [&quot;2&quot;, &quot;bdfh&quot;],
       &quot;5&quot;: [&quot;1&quot;, &quot;f&quot;],
       &quot;6&quot;: [&quot;1&quot;, &quot;h&quot;]
     }

 arena:

   This is a list which describes the shape of the playing area, the
   position of the walls, and the initial position of the atoms.

   It consists of a list strings. Each string in the list describes one
   row in the arena. Each character in the string represents a cell in
   the row and describes the initial contents of the cell.

   Some characters have a predefined meaning: '#' marks a wall and '.'
   marks an empty square. The other characters are from the keys of the
   atoms dictionary and identify the position of the atoms.

   All strings in the list must have the same length and the number of
   rows and columns must be the minimum required to contain the arena.

   example:

     &quot;arena&quot;: [
       &quot;...##########&quot;,
       &quot;...#....3#..#&quot;,
       &quot;...#.#...#..#&quot;,
       &quot;...#..#.....#&quot;,
       &quot;####...#...##&quot;,
       &quot;#..4#..4#...#&quot;,
       &quot;#...2#1..#.##&quot;,
       &quot;#..#..#.5#.#.&quot;,
       &quot;##1##..#.###.&quot;,
       &quot;.#....3...#..&quot;,
       &quot;.#....#.6.#..&quot;,
       &quot;.######.5.#..&quot;,
       &quot;......#####..&quot;
     ]

 molecule:

   This is a list which describes the composition of the molecule to be
   assembled. The specification is similar to that for the grid except
   only '.' or a single atom may appear in each cell.

   All strings must be the same length and the number of rows and columns
   must be the minimum required to contain the molecule.

   example:

     &quot;molecule&quot;: [
       &quot;.2.5.5&quot;,
       &quot;..4.3.&quot;,
       &quot;.3.4..&quot;,
       &quot;1.1.6.&quot;
     ]
</pre>
</div>
<div class="section" id="atom-descriptors">
<h1>Atom descriptors.</h1>
<pre class="literal-block">
An atom descriptor is a list containing two strings. The first string
indicates which atom or connector is to be used, the second string
is a list of bonds for that atom (an empty list for connectors.)

Each character in the second string represents one bond description, the
order in which they appear is not relevant.

example: [&quot;2&quot;, &quot;bdfh&quot;]

  By using the maps below (taken from the kp-atomix client) it can seen
  that this atom is a carbon atom with four single bonds at top-right
  top-left, bottom-right and bottom-left.
</pre>
<div class="section" id="maps-for-interpreting-atom-descriptors">
<h2>Maps for interpreting atom descriptors.</h2>
<pre class="literal-block">
These maps are taken from the kp-atomix client and can be used to
interpret atom descriptors.

      item_kind = {
          '1': 'atom-h', // hydrogen
          '2': 'atom-c', // carbon
          '3': 'atom-o', // oxygen
          '4': 'atom-n', // nitrogen
          '5': 'atom-s', // sulphur
          '6': 'atom-f', // fluorine
          '7': 'atom-cl', // chlorine
          '8': 'atom-br', // bromine
          '9': 'atom-p', // phosphorus
          'o': 'atom-crystal',
          'A': 'connector-horizontal',
          'B': 'connector-slash',
          'C': 'connector-vertical',
          'D': 'connector-backslash',

          'E': 'crystal-E',
          'F': 'crystal-F',
          'G': 'crystal-G',
          'H': 'crystal-H',
          'I': 'crystal-I',
          'J': 'crystal-J',
          'K': 'crystal-K',
          'L': 'crystal-L'
      },
      bond_kind = {
          'a': 'bond-top',
          'b': 'bond-top-right',
          'c': 'bond-right',
          'd': 'bond-bottom-right',
          'e': 'bond-bottom',
          'f': 'bond-bottom-left',
          'g': 'bond-left',
          'h': 'bond-top-left',
          'A': 'bond-top-double',
          'B': 'bond-right-double',
          'C': 'bond-bottom-double',
          'D': 'bond-left-double',
          'E': 'bond-top-triple',
          'F': 'bond-right-triple',
          'G': 'bond-bottom-triple',
          'H': 'bond-left-triple'
      },
</pre>
</div>
</div>
</div>
</body>
</html>
